package com.eh.factory.factoryMethod.pizza;

import com.google.common.collect.Lists;
import org.apache.commons.lang.StringUtils;

import java.util.List;

/**
 * Created by David on 2016/4/26.
 */
public abstract class Pizza {
    protected String name;
    protected String dough; // 面团
    protected String sauce; // 酱料
    protected List<String> toppings = Lists.newArrayList(); // 一套作料

    public void prepare() {
        System.out.printf("准备 [%s]...%n", name);
        System.out.println("搅拌面团...");
        System.out.println("添加酱料...");
        System.out.printf("添加佐料：[%s]...%n", StringUtils.join(toppings, ","));
    }

    public void bake() {
        System.out.println("烘烤 20 分钟...");
    }

    public void cut() {
        System.out.println("剪切...");
    }

    public void box() {
        System.out.println("打包...");
    }

    public String getName() {
        return name;
    }
}
